package edu.rjxy.xjdx.emps.servlet;

import edu.rjxy.xjdx.emps.service.UserService;
import edu.rjxy.xjdx.emps.service.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/logout")
public class LogoutServlet extends HttpServlet {
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getSession().invalidate();//销毁session
        request.getRequestDispatcher("/pages/login.jsp").forward(request,response);
    }
}
/*      //  String msg = null;
 *//* if(rs==1){
            path="/pages/main.jsp";
            msg="欢迎您，"+loginName;
        }else if(rs==-1){
            msg="用户名不存在";
        }else if (rs==0){
            msg="密码错误";
        }*//*
//        request.setAttribute("msg",msg);*/